#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
	int a[10];
	for (int i = 0; i < 10; i++) {
		scanf("%d", &a[i]);
	}
	int max = a[0];
	int h = 0;
	for (int j = 1; j < 10; j++) {
		if (max < a[j]) {
			max = a[j];
			h = j;
		}
	}
	for (int i = h; i < 9; i++) {
		a[h] = a[h + 1];
	}
	for (int i = 0; i < 9; i++) {
		printf(" %d", a[i]);
	}
	return 0;
}